1. Field of the Invention
The present invention relates to techniques for multiplexing encoded data of video, audio and data. More particularly, the present invention relates to data multiplexing devices multiplexing TS""s (Transport Streams) generated from encoded data of video, audio and data.
2. Description of the Background Art
Recently, researches of multimedia technologies have been vigorously conducted in various fields. Among them, the development of data multiplexing devices multiplexing encoded data of various media is particularly important. Hereinafter, a TS generator of MPEG (Moving Picture Experts Group) hereinafter referred to as MPEG2TS generator) will be described as an example of the data multiplexing devices. The MPEG2TS generator receives encoded data called an ES (Elementary Stream) generated by an encoding circuit as an input. The MPEG2TS generator multiplexes ES""s of video, audio and data in a time divisional manner, thereby generates one data stream.
FIG. 1 is a block diagram showing a schematic structure of a conventional MPEG2TS generator. The MPEG2TS generator includes a controller 101 controlling the MPEG2TS generator as a whole, a video ES buffer 102 buffering a video ES generated by an encoding circuit not shown, an audio ES buffer 103 buffering an audio ES generated by the encoding circuit, a data ES buffer 104 buffering a data ES generated by the encoding circuit, an output buffer 105 to which packetized video ES, audio ES and data ES are respectively written, and an output control unit 106 controlling an output of a TS packet buffered in output buffer 105 according to an external output request.
The TS must be generated in a format including appended header information on a picture basis in the case of the video and on a frame basis in the case of audio. Therefore, before the generation of the TS, the processing into a PES (Packetized ES) format including appended header information is required on the picture basis in the case of the video ES and on the frame basis in the case of the audio ES as shown in FIG. 2.
The TS is constituted from a group of packets of a fixed length, each packet storing an ES of media of one type. As shown in FIGS. 3A and 3B, the TS is constituted of the header information and the PES. One packet length of the TS is fixed to 188 bytes. As the data length of the PES is usually longer than the one packet length, one PES is divided into a plurality of TS packets. Hence, as shown in FIG. 3A, a TS packet including a head of a PES stores TS header information, PES header information and a part of an ES. Other TS packets store TS header information and the other part of the ES as shown in FIG. 3B.
In the MPEG2TS generator as shown in FIG. 1, controller 101 reads out respective ES""s from video ES buffer 102, audio ES buffer 103 and data ES buffer 104, and writes them sequentially into output buffer 105 after the generation of header information and the TS packetization. Output control unit 106 reads out the TS from output buffer 105 and supplies the TS as an output according to the external output request.
When the rate of TS generation by controller 101 differs from the rate of TS output from output control unit 106, the amount of output data at output control unit 106 may exceed or fall short of the required amount. Though the structure is usually made such that a total sum of an encoding rate does not exceed a total sum of an output rate, the total sum of the encoding rate can be lower than the total sum of the output rate. In such a case, the encoding rate is matched with the output rate through the deliberate insertion of a dummy packet called xe2x80x9cnull packetxe2x80x9d by controller 101. This matching is performed by controller 101 writing a xe2x80x9cnull packetxe2x80x9d into output buffer 105.
In the conventional MPEG2TS generator, however, as a detection of a picture boundary of the video ES and a frame boundary of the audio ES is required for the generation of PES, controller 101 analyzes each ES and extracts boundary information thereof. Therefore, ES analyzing means which is originally unnecessary is required.
In addition, as controller 101 needs control information at the time of encoding for the generation of the header information of the PES, the separate input of control information in addition to the ES is required from the encoding circuit. Still further, for the matching of the generation rate of the TS and the output rate of the TS, controller 101 must monitor an output state of the TS, generate and insert a xe2x80x9cnull packetxe2x80x9d if necessary in order to prevent the shortage of TS.
An object of the present invention is to provide a data multiplexing device capable of performing a control in a simple manner at the time of TS multiplexing.
Another object of the present invention is to provide a data multiplexing device capable of outputting a multiplexed TS packet at a fixed rate according to an external output request.
Still another object of the present invention is to provide a data multiplexing device capable of externally notifying a data boundary of multiplexed data.
According to one aspect of the present invention, a data multiplexing device includes a storing unit storing header information; a first holding unit holding encoded data of a plurality of media; a second holding unit holding packetized data; and a transfer controlling unit controlling a transfer of the header information stored in the storing unit and the encoded data held in the first holding unit and writing into the second holding unit as the packetized data.
As the transfer controlling unit can generate packetized data simply by controlling the transfer of the header information stored in the storing unit and the encoded data held by the first holding unit, media multiplexing can be easily performed.
Preferably, The data multiplexing device further includes an output controlling unit externally outputting data of a predetermined amount from the second holding unit according to an external transfer request.
As the output controlling unit supplies data of a predetermined amount as an output from the second holding unit according to the external transfer request, media multiplexed data can be supplied as an output at an externally requested rate.
Still preferably, the data multiplexing device further includes a flag appending unit appending a flag to data held by the second holding unit in an optional position, wherein the second holding unit externally outputs flag information in synchronization with packetized data.
As the second holding unit externally supplies the flag information as an output in synchronization with the packetized data, any position (data boundary) of the packetized data can be externally identified.
The foregoing and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings.